package com.tianpengtech.common.im.server.handler;

import org.tio.core.Aio;
import org.tio.core.ChannelContext;

import com.tianpengtech.common.im.common.ImPacket;
import com.tianpengtech.common.im.common.ImSessionContext;
import com.tianpengtech.common.im.common.pockets.ChatReqBody;

public class SysMessageHandler implements ImBsHandlerIntf {

	@Override
	public Object handler(ImPacket packet, ChannelContext<ImSessionContext, ImPacket, Object> channelContext)
			throws Exception {
		if (packet.getBody() == null) {
			throw new Exception("body is null");
		}
		ChatReqBody chatReqBody = ChatReqBody.parseFrom(packet.getBody());
		Aio.bindGroup(channelContext, chatReqBody.getGroup());
		return null;
	}

}
